<?php
defined('_JEXEC') or die('Restricted access');
?>
<h3>Kho Sim Số Đẹp Sài Thành <span style="float: right;">Tổng Số: <?php echo number_format($pagination->total, 0, '.', ','); ?> Sim &nbsp;</span></h3>
<div class="div_sim">
    <table border="0" cellpadding="5" width="100%" cellspacing="1">
        <tr align="center" class="tr_header_sim">
            <td>STT</td>
            <td height="25">Số sim</td>
            <td nowrap="nowrap">Nhà cung cấp</td>
            <td nowrap="nowrap">Giá bán</td>
           <!-- <td nowrap="nowrap">Kho</td> -->
            <td nowrap="nowrap">Mua Nhanh</td>
        </tr>
        <?php
        $stt=1;
        foreach($list as $review)
        {
            $link = JRoute::_( 'index.php?option=com_simbuy&task=add&simnumb='.$review->sim_numb );
            ?>
        <tr align="center" class="tr_sim">
            <td><?php echo $stt; ?></td>
            <td><?php JHTML::_('behavior.modal'); ?>
                <a href="<?php JURI::root()?>index.php?option=com_simbuy&task=simorder&num=<?php echo $review->sim_numb;?>"><?php echo $review->sim_numb;?></a>
            </td>
            <td align="left" style="padding-left: 10px;">
			<?php 
					switch(trim(strip_tags($review->provider_name)))
					{
						case "Viettel": 
							echo "<img alt='sim so dep Viettel' src='./images/sim/log_viettel.jpg' />";
							break;		
						case "MobiFone": 
							echo "<img alt='sim so dep MobiFone' src='./images/sim/logo_mobifone.jpg' />";
							break;
						case "VinaFone": 
							echo "<img alt='sim so dep Vinafone' src='./images/sim/logo_vinaphone.jpg' />";
							break;
						case "Vietnam Mobile":
							echo "<img src='./images/sim/logo-vietnam_mobile.jpg' />";
							break;	
						default: 
							echo $review->provider_name;
							break;
					}
				?>
			
			
			</td>
            <td><?php echo modSimCateHelper::thousandseperate($review->price);?>.000 <?php echo $review->curency; ?></td>
            
            <td><?php JHTML::_('behavior.modal'); ?>
                <a rel="{handler: 'iframe', size: {x: 600, y: 400}}" href="<?php echo $link; ?>" class="modal btn">Đặt Sim</a>
            </td>
        </tr>
        <?php
        $stt++;
    }
    ?>
	<tfoot>
		<tr>
			<td align="center" colspan="16">
				<?php
					 echo $pagination->getPagesLinks();
				?>
			</td>
		</tr>
	</tfoot>
    </table>
</div>